﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using model;
using Bll;

public partial class Searcha : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindList(null,null);
        }

    }
    void BindList(string sword,string kword)
    {
        AppIntroBll bll = new AppIntroBll();
        List<AppIntro> appintro = bll.GetList(sword,kword);
        ListView1.DataSource = appintro;
        ListView1.DataBind();
        GridView1.DataSource = appintro;
        GridView1.DataBind();
    }
    protected void btnJobSearch_Click(object sender, EventArgs e)
    {
        string sword = ddlSearch.Text;
        if (sword == "单位名称")
        {
            sword = "ename";
        }
        if (sword == "职位名称")
        {
            sword = "position";
        }
        if (sword == "工作地点")
        {
            sword = "place";
        }
        string kword = txtJobSearch.Text;
        BindList(sword,kword);
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        string sword = ddlSearch.Text;
        string kword = txtJobSearch.Text;
        BindList(sword, kword);
    }
}